# -*- coding: utf-8 -*-
"""
@Time : 2024/2/26 1:32 PM
@Author: imamhusan
@Des: 数据库管理
"""
from fastapi import FastAPI
from tortoise.contrib.fastapi import register_tortoise


async def register_mysql(app: FastAPI):
    register_tortoise(app=app,
                      db_url='mysql://class:123123@localhost:3306/class',
                      modules={"base": ["models.banner", "models.type", "models.goods",
                                        "models.user", "models.favor", "models.wx_user", "models.order"]},
                      generate_schemas=True,
                      add_exception_handlers=True
                      )
